package com.zyn.qianwen.user.controller;

import com.alibaba.dashscope.aigc.generation.GenerationResult;
import com.zyn.qianwen.user.entity.Result;
import com.zyn.qianwen.user.entity.TbQuestion;
import com.zyn.qianwen.user.service.ChatService;
import io.lettuce.core.dynamic.annotation.Param;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@Slf4j
@RequestMapping("/chat")
@RestController
public class ChatController {
    @Autowired
    private ChatService chatService;

    @RequestMapping("/question/get")
    public Result chatAi2(HttpServletRequest request, @RequestBody TbQuestion tbQuestion) throws Exception {
        return chatService.chatAiAndQuestion(request,tbQuestion);
    }



}
